package cn.bb.bbstudy.service.impl;

import cn.bb.bbstudy.dao.BlogDAO;
import cn.bb.bbstudy.pojo.Blog;
import cn.bb.bbstudy.service.BlogService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
@Service
public class BlogServiceImpl implements BlogService{

    @Resource
    private BlogDAO blogDAO;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return blogDAO.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Blog record) {
        return blogDAO.insert(record);
    }

    @Override
    public int insertSelective(Blog record) {
        return blogDAO.insertSelective(record);
    }

    @Override
    public Blog selectByPrimaryKey(Integer id) {
        return blogDAO.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Blog record) {
        return blogDAO.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Blog record) {
        return blogDAO.updateByPrimaryKey(record);
    }

    public int count(String uid) {
        return blogDAO.count(uid);
    }

    public Page<Blog> findAllByUIdDesc(String uid) {
        return blogDAO.findAllByUIdDesc(uid);
    }

    public Page<Blog> findAllDesc() {
        return blogDAO.findAllDesc();
    }

    public Blog findOneByBid(String bid) {
        return blogDAO.findOneByBid(bid);
    }

    @Override
    public Page<Blog> findAllByCIdDesc(int cid) {
        return blogDAO.findAllByCIdDesc(cid);
    }

}
